Skip to content

feat: implement Infra layer for favorite heritages list (WorldHeritageQueryService) / お気に入り一覧のInfra層実装(WorldHeritageQueryService) - #569

Closed
zigzagdev wants to merge 2 commits into
feat/user-favoritefrom
feat/user-favorite-index-list-infra
Closed

feat: implement Infra layer for favorite heritages list (WorldHeritageQueryService) / お気に入り一覧のInfra層実装(WorldHeritageQueryService)#569
zigzagdev wants to merge 2 commits into
feat/user-favoritefrom
feat/user-favorite-index-list-infra

Conversation

@zigzagdev

Copy link
Copy Markdown
Owner

Motivation / 目的

Following #564 (FavoriteRepository::getFavoriteWorldHeritageIds), add the remaining Infra-level piece needed for the favorites list: given a list of world heritage ids, return them as a WorldHeritageDtoCollection so the Application layer doesn't need to duplicate the existing payload-building logic (buildWorldHeritagePayload + WorldHeritageDtoCollectionFactory) already used by getAllHeritages() / searchHeritages().

Pagination is intentionally out of scope here — it will be added later once needed; getHeritagesByIds() just returns the full collection for the ids it's given.

What I have done / 実施内容

  • Added WorldHeritageQueryServiceInterface::getHeritagesByIds(array $ids): WorldHeritageDtoCollection
  • Implemented it in WorldHeritageQueryService, reusing the same findByIdsPreserveOrder() + buildWorldHeritagePayload() + buildDtoFromCollection() pipeline as searchHeritages()
  • Added integration tests against the real test database (seeded via DatabaseSeeder)

Test Results / テスト結果

  • test_returns_world_heritage_dto_collection
  • test_preserves_order_of_given_ids
  • test_returns_empty_collection_when_no_ids_given
  • test_skips_missing_ids_without_failing

Full suite: 197 passed.

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.95918% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.89%. Comparing base (b4acd34) to head (de8dc1a).
⚠️ Report is 1 commits behind head on feat/user-favorite.

Files with missing lines Patch % Lines
...orldHeritageQueryService_getHeritagesByIdsTest.php 97.67% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##             feat/user-favorite     #569      +/-   ##
========================================================
+ Coverage                 63.70%   63.89%   +0.19%     
- Complexity                 1657     1666       +9     
========================================================
  Files                       142      143       +1     
  Lines                      8607     8656      +49     
========================================================
+ Hits                       5483     5531      +48     
- Misses                     3124     3125       +1     
Files with missing lines Coverage Δ
...omains/WorldHeritage/WorldHeritageQueryService.php 96.56% <100.00%> (+0.08%) ⬆️
...orldHeritageQueryService_getHeritagesByIdsTest.php 97.67% <97.67%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zigzagdev

Copy link
Copy Markdown
Owner Author

Infra layer is already merged (#564); this work is being consolidated into a single Application-layer commit instead.

@zigzagdev zigzagdev closed this Aug 8, 2026
@zigzagdev
zigzagdev deleted the feat/user-favorite-index-list-infra branch August 8, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant